<!-- inc:header -->
<script type="text/javascript" src="js/php.js"></script>
<div class="notice"><div class="p">
	<table width="100%" cellpadding="0" cellspacing="0">
	<tr>
		<td><span class="lead">&nbsp;&raquo; <a href="{:site_url('list')}module_id={:$module_id}&">{:$m_rs[title]}</a> &raquo; 添加/编辑信息</span></td>
	</tr>
	</table>
</div></div>

<div class="tab">
	<div class="table">
		<div class="left">&nbsp;</div>
		<ul>
			<li class="over" id="_tab_main" title="主要内容信息，其中红色星号信息为必填" onclick="tab_set('main')">主要信息</li>
			<li class="out" id="_tab_biz" title="电子商务功能，可在这里设置相关价格，优惠促销等" onclick="tab_set('biz')"{if(!$m_rs[if_biz])} style="display:none;"{end}>电子商务</li>
			<li class="out" id="_tab_ext" title="所有用户在后台创建模块时设定的一些非必填的扩展字段均在这里使用" onclick="tab_set('ext')">可选扩展</li>
			<li>（<span style="color:red;">*</span> 号必填）</li>
		</ul>
	</div>
</div>

<form method="post" action="{:site_url('list,setok')}module_id={:$module_id}&id={:$id}" onsubmit="return to_submit();">
<div id="_msg_main">
	<div class="table">
		<div class="left"><span class="red">*</span> 主题：</div>
		<input type="text" name="subject" id="subject" class="long_input" value="{:$rs[title]}">
	</div>

	<!-- if($m_rs[if_url_m]) -->
	<div class="table">
		<div class="left"><span class="red">*</span> 链接网址：</div>
		<input type="text" name="link_url" id="link_url" class="long_input" value="{:$rs[link_url]}">
		<select name="target" id="target">
		<option value="0">当前窗口</option>
		<option value="1">新窗口</option>
		</select>
	</div>
	<!-- end -->

	<!-- if($ifcate) -->
	<div class="table">
		<div class="left"><span class="red">*</span> 分类：</div>
		{:$cate_html}
	</div>
	<!-- end -->

	<!-- if($m_rs[if_thumb] && $m_rs[if_thumb_m]) -->
	<input type="hidden" name="thumb_id" id="thumb_id" value="{:$rs[thumb_id]}">
	<div class="table">
		<div class="left">
			<div style="padding-bottom:3px;"><span class="red">*</span> 缩略图：</div>
			<div style="padding-bottom:3px;"><input type="button" class="button" value="选择" onclick="phpjs_img('thumb_id','thumb_view');" /> &nbsp;</div>
			<input type="button" value="删除" class="button" onclick="phpjs_clear_img('thumb_id','thumb_view')" /> &nbsp;
		</div>
		<table cellpadding="0" cellspacing="0">
		<tr>
			<td align="left" id="thumb_view"><!-- if($rs[thumb]) --><img src="{:$rs[thumb]}" border="0" /><!-- else --><img src="images/nopic.gif" border="0" /><!-- end --></td>
		</tr>
		</table>
	</div>
	<!-- end -->

	<!-- $extlist_must AS $key=>$value -->
	{:$value}
	<!-- end -->

</div>
<div id="_msg_biz">
	<div class="table">
		<div class="left">售价：</div>
		<input type="text" name="price" id="price" value="{:$rs[price]}">
		<span class="clue_on"> 这里的售价均为RMB</span>
	</div>
	<div class="table">
		<div class="left">虚拟产品：</div>
		<input type="checkbox" name="virtual" id="virtual" value="1"{if($rs[virtual])} checked{end}>
		<span class="clue_on"> 如果该产品是虚拟产品，请打上勾（购买虚拟产品不需填写地址，不计运费）</span>
	</div>
	<div class="table">
		<div class="left">特价：</div>
		<input type="checkbox" name="ifspecial" id="ifspecial" value="1"{if($rs[ifspecial])} checked{end}>
		<span class="clue_on"> 如果该价格是特价产品，请打上勾</span>
	</div>
	<div class="table">
		<div class="left">免费：</div>
		<input type="checkbox" name="free" id="free" value="1"{if($rs[free])} checked{end}>
		<span class="clue_on"> 如果该产品免费，请打上勾</span>
	</div>
	<div class="table">
		<div class="left">促销开始时间：</div>
		<input type="text" name="promotion_start" id="promotion_start" onfocus="show_date('promotion_start')" value="{:$rs[promotion_start] ? date('Y-m-d',$rs[promotion_start]) : ''}">
		<span class="clue_on"> 为空不促销</span>
	</div>
	<div class="table">
		<div class="left">促销结束时间：</div>
		<input type="text" name="promotion_end" id="promotion_end" onfocus="show_date('promotion_end')" value="{:$rs[promotion_end] ? date('Y-m-d',$rs[promotion_end]) : ''}">
		<span class="clue_on"> 为空表示促销将没有时间限制（如果有促销）</span>
	</div>
	<div class="table">
		<div class="left">重量：</div>
		<input type="text" name="weight" id="weight" class="short_input" value="{:$rs[weight]}">
		<span class="clue_on"> 单位是：Kg</span>
	</div>
	<div class="table">
		<div class="left">免运费：</div>
		<input type="checkbox" name="freeshipping" id="freeshipping" value="1"{if($rs[freeshipping])} checked{end}>
		<span class="clue_on"> 如果该产品免运费，请打上勾</span>
	</div>
</div>

<div id="_msg_ext">
	<div class="table">
		<div class="left">样式：</div>
		<input type="text" name="style" id="style" class="long_input" value="{:$rs[style]}">
		<span class="clue_on"> 不熟悉CSS请留空</span>
	</div>

	<div class="table">
		<div class="left">常用样式：</div>
		<input type="button" class="button1" value="加粗" onclick="style_set('font-weight:bold');">
		<input type="button" class="button1" value="斜体" onclick="style_set('font-style:italic');">
		<input type="button" class="button1" value="下划线" onclick="style_set('text-decoration:underline');">
		<select name="color" onchange="style_color(this.value);">
		<option value="">默认颜色</option>
		<option value="red" style="color:red;">红色</option>
		<option value="darkred" style="color:darkred;">深红色</option>
		<option value="green" style="color:green;">绿色</option>
		<option value="darkgreen" style="color:darkgreen;">深绿色</option>
		<option value="blue" style="color:blue;">蓝色</option>
		<option value="darkblue" style="color:darkblue;">深蓝色</option>
		<option value="purple" style="color:purple;">紫色</option>
		<option value="yellow" style="color:yellow;">黄色</option>
		<option value="gold" style="color:gold;">金色</option>
		<option value="saddlebrown" style="color:saddlebrown;">棕色</option>
		</select>
	</div>

	<div class="table">
		<div class="left">标识串：</div>
		<input type="text" name="identifier" id="identifier" value="{:$rs[identifier]}">
		<span class="clue_on"> 仅限字母、下划线及数字。如果支持HTML，将做为HTML名称使用，允许为空</span>
	</div>

	<div class="table">
		<div class="left">模板文件：</div>
		<input type="text" name="tplfile" id="tplfile" value="{:$rs[tplfile]}">
		<span class="clue_on"> 不带后缀，不设置将使用系统自带模板文件：msg_{:$m_rs[identifier]}</span>
	</div>

	<!-- if($m_rs[if_propety]) -->
	<div class="table">
		<div class="left">属性：</div>
		<input type="checkbox" name="istop" id="istop" value="1"{if($rs[istop])}checked{end}> 置顶 
		<input type="checkbox" name="isvouch" id="isvouch" value="1"{if($rs[isvouch])}checked{end}> 推荐 
		<input type="checkbox" name="isbest" id="isbest" value="1"{if($rs[isbest])}checked{end}> 精华 
	</div>
	<!-- end -->

	<div class="table">
		<div class="left">显示：</div>
		<input type="radio" name="hidden" value="0"{if(!$rs[hidden])} checked{end} /> 显示
		&nbsp; 
		<input type="radio" name="hidden" value="1"{if($rs[hidden])} checked{end} /> 隐藏
		<span class="clue_on"> 隐藏后列表中不体现，但用户仍可访问</span>
	</div>

	<!-- if($m_rs[if_hits]) -->
	<div class="table">
		<div class="left">点击/好评/差评：</div>
		<input type="text" name="hits" id="hits" class="short_input" value="{:$rs[hits]}"> ／
		<input type="text" name="good_hits" id="good_hits" class="short_input" value="{:$rs[good_hits]}"> ／
		<input type="text" name="bad_hits" id="bad_hits" class="short_input" value="{:$rs[bad_hits]}">
	</div>
	<!-- end -->

	<!-- if($m_rs[if_thumb] && !$m_rs[if_thumb_m]) -->
	<input type="hidden" name="thumb_id" id="thumb_id" value="{:$rs[thumb_id]}">
	<div class="table">
		<div class="left">
			<div style="padding-bottom:3px;">缩略图：</div>
			<div style="padding-bottom:3px;"><input type="button" class="button" value="选择" onclick="phpjs_img('thumb_id','thumb_view');" /> &nbsp;</div>
			<input type="button" value="删除" class="button" onclick="phpjs_clear_img('thumb_id','thumb_view')" /> &nbsp;
		</div>
		<table cellpadding="0" cellspacing="0">
		<tr>
			<td align="left" id="thumb_view"><!-- if($rs[thumb]) --><img src="{:$rs[thumb]}" border="0" /><!-- else --><img src="images/nopic.gif" border="0" /><!-- end --></td>
		</tr>
		</table>
	</div>
	<!-- end -->


	<div class="table">
		<div class="left"><span class="red">*</span> 发布人：</div>
		<select name="author_type" id="author_type">
		<option value="admin"{if($rs[author_type] == "admin")} selected{end}>管理员</option>
		<option value="user"{if($rs[author_type] == "user")} selected{end}>会员</option>
		<option value="guest"{if($rs[author_type] == "guest")} selected{end}>游客</option>
		</select>
		<input type="text" name="author" id="author" value="{:$rs[author] ? $rs[author] : $_SESSION[admin_name]}">
	</div>

	<div class="table">
		<div class="left"><span class="red">*</span> 发布时间：</div>
		<input type="text" name="post_date" id="post_date" onfocus="show_date('post_date',true);" value="{:date('Y-m-d H:i:s',$rs[post_date])}">
		<span class="clue_on"> 时间格式是：YYYY-MM-DD hh:ii:ss</span>
	</div>

	<div class="table">
		<div class="left">IP：</div>
		<input type="text" name="ip" value="{:$rs[ip]}">
		<span class="clue_on"> IP地址格式如：127.0.0.1，不清楚请不要留空或是保持显示值</span>
	</div>

	<div class="table">
		<div class="left">排序：</div>
		<input type="text" name="taxis" id="taxis" value="{:intval($rs[taxis])}" size="10">
		<input type="button" onclick="set_taxis_time('taxis');" value="时间戳排序">
		<span class="clue_on">值越大越往前靠</span>
	</div>

	<div class="table">
		<div class="left">静态页模式：</div>
		<select name="htmltype" id="htmltype">
			<option value="date"{if($rs[htmltype] == "date")} selected{end}>HTML目录/语言ID/年月/日/*.html</option>
			<option value="mid"{if($rs[htmltype] == "mid")} selected{end}>HTML目录/语言ID/模块标识/*.html</option>
			<option value="cateid"{if($rs[htmltype] == "cateid")} selected{end}>HTML目录/语言ID/模块标识/分类标识/*.html</option>
			<option value="root"{if($rs[htmltype] == "root")} selected{end}>HTML目录/语言ID/*.html（注意不能为：index标识）</option>
		</select>
	</div>

	<!-- if($m_rs[if_point]) -->
	<div class="table">
		<div class="left">积分：</div>
		<input type="text" name="points" id="points" class="short_input" value="{:$rs[points]}">
	</div>
	<!-- end -->

	<!-- if(!$m_rs[if_url_m]) -->
	<div class="table">
		<div class="left">链接网址：</div>
		<input type="text" name="link_url" id="link_url" class="long_input" value="{:$rs[link_url]}">
		<select name="target" id="target">
		<option value="0">当前窗口</option>
		<option value="1">新窗口</option>
		</select>
	</div>
	<!-- end -->

	<div class="table">
		<div class="left">SEO关键字：</div>
		<input type="text" name="keywords" id="keywords" value="{:$rs[keywords]}" class="long_input">
		<span class="clue_on"></span>
	</div>

	<div class="table">
		<div class="left">&nbsp;</div>
		<span class="clue_on">这些信息将在title中的keywords体现，多个关键字请用英文逗号隔开</span>
	</div>

	<div class="table">
		<div class="left">SEO描述：</div>
		<input type="text" name="description" id="description" value="{:$rs[description]}" class="long_input">
		<span class="clue_on">内容描述，仅限SEO使用</span>
	</div>

	<div class="table">
		<div class="left">简要描述：</div>
		<textarea id="note" name="note" style="width:550px;height:90px;">{:$rs[note]}</textarea>
	</div>

	<!-- $extlist_need AS $key=>$value -->
	{:$value}
	<!-- end -->
</div>

<div class="table">
	<div class="left">&nbsp;</div>
	<input type="submit" class="button" id="_phpok_submit" name="article_submit" value=" 提交 ">
</div>

</form>

<script type="text/javascript">
tab_set("main");
<!-- $extlist AS $key=>$value -->
	<!-- if($value[input] == "opt") -->
	phpjs_parent_opt('{:$value[default_val]}','{:$value[identifier]}','{:$value[id]}');
	<!-- elseif($value[input] == "img") -->
	phpjs_viewpic('{:$value[default_val]}','{:$value[identifier]}');
	<!-- elseif($value[input] == "download") -->
	phpjs_viewdown('{:$value[default_val]}','{:$value[identifier]}');
	<!-- elseif($value[input] == "video") -->
	phpjs_viewvideo('{:$value[default_val]}','{:$value[identifier]}');
	<!-- end -->
<!-- end -->
function to_submit()
{
	var subject = getid("subject").value;
	if(!subject)
	{
		alert("主题不允许为空");
		tab_set("main");
		getid("subject").focus();
		return false;
	}
	//[发布人]
	var author = getid("author").value;
	if(!author)
	{
		alert("发布人账号不允许为空");
		tab_set("ext");
		getid("author").focus();
		return false;
	}
	//发布时间
	var post_date = getid("post_date").value;
	if(!post_date)
	{
		alert("发布时间不允许为空");
		tab_set("ext");
		getid("post_date").focus();
		return false;
	}
	//判断核心模块是否必填
	<!-- if($ifcate) -->
	var cate_id = getid("cate_id").value;
	if(!cate_id || cate_id == "0")
	{
		alert("请选择分类");
		tab_set("main");
		return false;
	}
	<!-- end -->
	<!-- if($m_rs[if_thumb] && $m_rs[if_thumb_m]) -->
	var thumb_id = getid("thumb_id").value;
	if(!thumb_id)
	{
		alert("请选择缩略图信息");
		tab_set("main");
		return false;
	}
	<!-- end -->
	<!-- $extlist AS $key=>$value -->
	<!-- if($value[if_must] && $value[input] != "radio" && $value[input] != "checkbox") -->
		<!-- if($value[input] != "edit") -->
		var {:$value[identifier]} = getid("{:$value[identifier]}").value;
		<!-- else -->
		var oEditor_{:$value[identifier]} = FCKeditorAPI.GetInstance('{:$value[identifier]}');
		var {:$value[identifier]} = oEditor_{:$value[identifier]}.GetXHTML(true);
		<!-- end -->
		if(!{:$value[identifier]})
		{
			alert("{:$value['error_note'] ? $value['error_note'] : '所有加红色星号信息均必须填写'}");
			tab_set("main");
			return false;
		}
	<!-- end -->
	<!-- end -->
	getid("_phpok_submit").disabled = true;
}
</script>
<!-- inc:footer -->